package cn.nosql.rpc;

import cn.nosql.myservice.MyNoSqlService;
import org.apache.thrift.TException;
import java.util.List;

public class MyRpcStartImpl implements MyRpcService.Iface {
    @Override
    public String executeSqlQuery(String sql) throws TException {
        return MyNoSqlService.getInstance().getNoSql().executeSqlQuery(sql);
    }

    @Override
    public List<Byte> insertNoSql(String cache_name, String method_name, List<Byte> key, List<Byte> value) throws TException {
        return MyNoSqlService.getInstance().getNoSql().insertNoSql(cache_name, method_name, key, value);
    }

    @Override
    public List<Byte> executeNoSql(String cache_name, String method_name, List<Byte> key) throws TException {
        return MyNoSqlService.getInstance().getNoSql().executeNoSql(cache_name, method_name, key);
    }

//    @Override
//    public String executeSqlQuery(String sql) throws TException {
//        return MyNoSqlService.getInstance().getNoSql().executeSqlQuery(sql);
//    }
//
//    @Override
//    public ByteBuffer insertNoSql(String cache_name, String method_name, ByteBuffer key, ByteBuffer value) throws TException {
//        return MyNoSqlService.getInstance().getNoSql().insertNoSql(cache_name, method_name, key, value);
//    }
//
//    @Override
//    public ByteBuffer executeNoSql(String cache_name, String method_name, ByteBuffer key) throws TException {
//        MyNoSql noSql = new MyNoSql();
//        return noSql.executeNoSql(cache_name, method_name, key);
//    }
}
